#include <stdio.h>
#include <stdarg.h>
#include "types.h"
#include "linkerset.h"
#include "app.h"

void group_1_1( u8 id, u8* apdu_buffer )
{
    printf( "Function: %s, Line: %d\n", __FUNCTION__, __LINE__ );
    printf( "id:%d,apdu_buffer_addr:%p", id, apdu_buffer );
    return;
}

void group_1_1_var( va_list args )
{
    int id = va_arg( args, int ); //  变长入参使用 int 而不是 u8
    u8* apdu_buffer = va_arg( args, u8* );
    group_1_1( (u8)id, apdu_buffer ); // 将 int 转换回 u8
}

void group_1_2()
{
    printf( "Function: %s, Line: %d\n", __FUNCTION__, __LINE__ );
    return;
}

CTD_LINKERSET_DEFINE( cmdTable_group1, COMMAND_ITEM ) = {
    { 0x01, 0x01, group_1_1_var },
    { 0x01, 0x02, group_1_2 },
};
